package club.zbiao.modules.system.service;

import club.zbiao.modules.system.domain.BaseEntity;
import club.zbiao.modules.system.service.dto.BaseDTO;
import org.springframework.cache.annotation.CacheEvict;

/**
 * @author zbiao
 * @date 2019-05-02
 */
public interface BaseService<D extends BaseDTO, E extends BaseEntity> {


    /**
     * create
     *
     * @param resources
     * @return
     */
    @CacheEvict(allEntries = true)
    D create(E resources);

    /**
     * update
     *
     * @param resources
     */
    @CacheEvict(allEntries = true)
    void update(E resources);

    /**
     * delete
     *
     * @param id
     */
    @CacheEvict(allEntries = true)
    void delete(Long id);

}